package com.training.bt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.training.bt.entity.Resource;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {
    boolean existsByTitle(String title);

    Page<Resource> selectPagedResourcesByKeywordAndTagId(
            Page<Resource> page,
            @Param("keyword") String keyword,
            @Param("tagId") Long tagId);
}